/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package BUS;

import DAL.ConnectUnit;
import java.sql.ResultSet;
import javax.swing.JComboBox;
import org.jdesktop.swingx.JXDatePicker;

/**
 *
 * @author HOASEN
 */
public class Unity {
    ConnectUnit conn=null;
    public Unity()
    {
        conn=DAL.DAL.getDAL();
    }
    public void load_combobox(JComboBox cb,String table,String column) throws Exception
    {
        ResultSet rss=conn.Select(table);
        while(rss.next())
        {
            String k=rss.getString(column);
            cb.addItem(k);
        }
    }
    public String ToString(JXDatePicker date)
    {
        int str=date.getDate().getDate();
        return (date.getDate().getYear()+1900)+"-"+(date.getDate().getMonth()+1)+"-"+str;
    }
            
    
}
